Skip to content

add HttpServer::new_async#2413

Draft
aliemjay wants to merge 2 commits intoactix:mainfrom
aliemjay:web/feat/httpserver-new-async
Draft

add HttpServer::new_async#2413
aliemjay wants to merge 2 commits intoactix:mainfrom
aliemjay:web/feat/httpserver-new-async

Conversation

@aliemjay
Copy link
Copy Markdown
Member

PR Type

Feature

PR Checklist

  • Tests for the changes have been added / updated.
  • Documentation comments have been added / updated.
  • A changelog entry has been made for the appropriate packages.
  • Format code with the latest stable rustfmt.
  • (Team) Label with affected crates and semver status.

Overview

Closes #2286

@aliemjay
Copy link
Copy Markdown
Member Author

Depends on actix/actix-net#397

FnOnce was chosen for the closure because otherwise it would be incovenient to use - the users are required to clone captures before the async block:

HttpServer::new_async(move || {
    let data = data.clone();
    async move { App::new().data(data) }
})

HttpServer::new was relaxed to accept FnOnce too for consistency.

@robjtede robjtede added this to the actix-web post-v4 milestone Nov 25, 2021
@robjtede
Copy link
Copy Markdown
Member

not pursuing async server builders this cycle so delaying this til post v4

@robjtede robjtede marked this pull request as draft December 4, 2021 19:41
@robjtede robjtede removed this from the actix-web post-v4 milestone Mar 1, 2022
@aliemjay aliemjay force-pushed the web/feat/httpserver-new-async branch from 33ce81a to 4b098d3 Compare March 29, 2022 17:39
@aliemjay aliemjay added B-semver-major breaking change requiring a major version bump A-web project: actix-web labels Mar 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-web project: actix-web B-semver-major breaking change requiring a major version bump

Projects

None yet

Development

Successfully merging this pull request may close these issues.

async HttpServer::new as alternative to data_factory

2 participants